﻿@model IEnumerable<Mvc.Models.Permission>

@{
    ViewBag.Title = "Index";
    
}

<h2>Index</h2>

<p>
    @Ajax.ActionLink("Adicionar", "Create", "Permissions", new AjaxOptions { UpdateTargetId = "content", InsertionMode = InsertionMode.Replace, HttpMethod = "GET" },new { @class = "btn btn-default navbar-btn" })

</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Controlador)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Accion)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Concedido)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    
  
        string con="";
        if(item.Concedido){
        con="SI";
        }else{
        con="NO";
        }
            
            
        
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Controlador)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Accion)
        </td>
        <td>
            @Html.DisplayFor(modelItem => con)
        </td>
        <td>
            @Ajax.ActionLink("Cambiar", "Edit", "Permissions", new { id = item.PermissionId }, new AjaxOptions { UpdateTargetId = "content", InsertionMode = InsertionMode.Replace, HttpMethod = "GET" })
            @Ajax.ActionLink("Editar", "modify", "Permissions", new { id = item.PermissionId }, new AjaxOptions { UpdateTargetId = "content", InsertionMode = InsertionMode.Replace, HttpMethod = "GET" })

        </td>
    </tr>
}

</table>
